﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using EHTSaleManager.Code.BLL;
using EHTSaleManager.Code.Entity;
using EHTSaleManager.Code.Utility;

namespace EHTSaleManager.UIAdmin
{
    public partial class AdminFAQsConfirmSuccess : System.Web.UI.Page
    {
        public Int32 ID = -1;
        protected void Page_Load(object sender, EventArgs e)
        {

            try
            {
                ID = Int32.Parse(Request.QueryString["ID"].ToString());
            }
            catch (Exception ex)
            {
                ID = -1;
            }

            if (ID != -1)
            {
                FAQs theFAQs = FAQsProvider.GetFAQsbyID(ID);
                this.ltrMessage.Text = "Er du sikker sletter FAQs : " + theFAQs.TitleFAQs;
                ViewState["ID"] = theFAQs.ID;
            }
        }

        protected void btnDelete_Click(object sender, EventArgs e)
        {
            if (ViewState["ID"] != null)
            {
                ID = Int32.Parse(ViewState["ID"].ToString());
                FAQsProvider.DeleteFAQs(ID);
            }

            Response.Redirect("AdminFAQs.aspx");
        }

        protected void btnCancel_Click(object sender, EventArgs e)
        {
            Response.Redirect("AdminFAQs.aspx");
        }
    }
}